package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.报价金融详细表Model;
import com.iris.live.services.data.models.报价金融详细表ModelPK;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by xiO on 2016/11/28.
 */

@Transactional
public interface 报价金融详细表Repository extends JpaRepository<报价金融详细表Model, 报价金融详细表ModelPK>, JpaSpecificationExecutor<报价金融详细表Model> {


    @Query("select a from 报价金融详细表Model a where a.金融编号=?1")
    List<报价金融详细表Model> findListByComboId(int id);

    @Modifying
    @Query("DELETE FROM 报价金融详细表Model u where u.金融编号=?1")
    void deleteByFinanceNum(Integer maxFinanceNum);

}
